1. Field of the Invention
This invention relates to an image processing method in which projection calculations of images are performed on the basis of image data coded by use of a run length representation.
2. Description of the Prior Art
The technical term "run length representation" is understood in the art to mean a method in which an image is represented by indicating how many white pixels (or black pixels) lie on respective continuous lines of the image.
In general, projection calculations of images have been utilized as techniques of image processing in object recognition and character recognition, and to provide a sense of sight for industrial robots. A projection calculation is a calculation to obtain the number of black pixels that exist in the respective rows of the image along an x-y coordinate system, as shown in FIG. 8.
In a projection calculation, the horizontal and vertical axes of an image are usually used as the x-y coordinate system. However, in many cases, a projection, which is projected onto a coordinate axis v of a U-V coordinate system inclined by a predetermined angle .theta. with respect to the x-y coordinate system as shown in FIG. 9, must be calculated.
Conventionally, such a projection is calculated directly from the image data expanded on a pixel-by-pixel basis in a memory unit. Specifically, the number of the respective pixels are received from the memory unit. If the received pixel is a black pixel, then one (1) is added to the value of the projection calculation.
For example, when a projection projected onto the y-axis is expressed using a program in the conventional method, the program is as follows: ##EQU1## where an array "a" represents an image, and "h" represents a projection. Constants X and Y represent horizontal and vertical lengths of the image, respectively. This means that the accumulation of black pixels in the respective lines of the Y-direction is performed.
In the case of the conventional method, the number of repetitions of access to the pixel memory and the amount of processing are very large. Thus, it is difficult to obtain sufficiently high-speed operation without depending on additional hardware. Moreover, even with such additional hardware, when a large-size image is required, the amount of additional hardware, such as a memory or the like, can become very large.
In addition, image data usually have a large amount of information. Thus, such image data are usually compressed using a run length representation into coded data, and stored in the memory. When projections are calculated from such coded image data using the conventional method, the coded data must be decoded, and then expanded to pixels in the memory.
Then, the projection projected onto the prescribed coordinate axis is calculated from such image data in the memory. Consequently, the efficiency of these procedures is low, and this has been disadvantageous.